package com.heo.music.player.config.swagger;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.schema.ModelBuilderPlugin;
import springfox.documentation.spi.schema.contexts.ModelContext;
import springfox.documentation.swagger.common.SwaggerPluginSupport;


/**
 * @author 星天无极
 * @create 2022-05-19 10:48
 **/
@Slf4j
@ConditionalOnProperty(
    name = {"knife4j.enable"},
    havingValue = "true"
)
@Component
public class CustomModelBuilderPlugin implements ModelBuilderPlugin {
    @Override
    public void apply(ModelContext context) {
    }

    @Override
    public boolean supports(@NonNull DocumentationType delimiter) {
        return SwaggerPluginSupport.pluginDoesApply(delimiter);
    }
}
